Skip to content

FAC-2305 Hydrate response dates consistently in SDK 6.0 - #120

Closed
javorosas wants to merge 10 commits into
mainfrom
FAC-2305-fix-response-date-types
Closed

javorosas wants to merge 10 commits into
mainfrom
FAC-2305-fix-response-date-types

Conversation

@javorosas

@javorosas javorosas commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Hydrate ISO date fields across SDK JSON responses and locally validated webhook events.
  • Align public response date types and nullable invoice, retention, and customer dates with runtime values.
  • Preserve SAT stamp.date as a wall-clock string and leave caller metadata untouched.

Release coordination

This PR contains only the date/type correction and its tests. The SDK 6.0 version bump, changelog, dependency updates, ESLint configuration, and ESM/CommonJS packaging are in a separate PR based on this branch. Merge this PR first, then the release PR; these changes require a major release.

Validation

  • pnpm install --frozen-lockfile
  • pnpm test: build, 56 runtime tests, type tests
  • pnpm run lint

@javorosas javorosas added the bug label Sep 22, 2026
@javorosas javorosas changed the title FAC-2305 Hydrate response dates to match SDK types FAC-2305 Hydrate response dates consistently in SDK 6.0 Sep 22, 2026
@javorosas
javorosas requested a lite review from Copilot September 22, 2026 22:30
@javorosas javorosas self-assigned this Sep 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

Add runtime coverage confirming cancellation.last_checked hydrates to a Date.

Review effort: Lite
Findings: None

What changed in this PR

Updates SDK 6.0 to hydrate ISO response dates as Date objects while preserving SAT wall-clock timestamps and caller metadata.

Changes:

  • Added centralized date hydration for API responses and validated webhooks.
  • Updated nullable and newly exposed date types.
  • Added runtime/type tests and documented the breaking release.
File Description
test/​web/​runtime-compat.web.test.ts Tests browser date hydration.
test/​node/​signed-download-urls.node.test.ts Tests signed URL dates.
test/​node/​runtime-compat.node.test.ts Tests Node response and webhook hydration.
test-d/​runtime-types.test-d.ts Verifies updated TypeScript types.
src/​wrapper.ts Adds centralized response date hydration; coverage is needed for cancellation.last_checked.
src/​types/​retention.ts Aligns retention date types.
src/​types/​organization.ts Aligns organization date types.
src/​types/​invoice.ts Updates nullable and cancellation date types.
src/​types/​common.ts Updates shared date types.
src/​tools/​webhooks.ts Hydrates locally validated webhook events.
package.json Bumps version to 6.0.0.
CHANGELOG.md Documents breaking changes.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@javorosas

Copy link
Copy Markdown
Member Author

Atendí la observación general de Copilot en d8a90a4: la prueba runtime existente ahora verifica explícitamente que cancellation.last_checked se hidrate como Date. Verificado con pnpm run test:node (46 pruebas) y pnpm run lint. Copilot no creó review threads inline que requieran resolveReviewThread.

@javorosas

Copy link
Copy Markdown
Member Author

Consolidated into #121, which now targets main and includes all changes from this branch. Continue review and release coordination in #121.

@javorosas javorosas closed this Sep 30, 2026
@javorosas
javorosas removed this pull request from stack #122 September 30, 2026 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants